package ai.ilikeplaces.ygp.client;

import ai.ilikeplaces.ygp.conf.YGPClientModule;
import ai.ilikeplaces.ygp.impl.Client;
import ai.ilikeplaces.ygp.impl.ClientFactory;
import com.google.inject.Guice;
import com.google.inject.Injector;

/**
 * We are writing a client to the guice module. But also, it is a client to YGP web service. Hence the odd name!
 *
 * Created by IntelliJ IDEA.
 * User: <a href="http://www.ilikeplaces.com"> http://www.ilikeplaces.com </a>
 * Date: 12/18/10
 * Time: 9:33 PM
 */
public class YGPClientClient {

     public static void main(final String[] args){
        final Injector injector = Guice.createInjector(new YGPClientModule());
        final ClientFactory clientFactory = injector.getInstance(ClientFactory.class);
        final Client client = clientFactory.getInstance("http://where.yahooapis.com/v1/place/");
         System.out.println(client.getPlace("1"));
         System.out.println(client.getPlaceValue("1", "name"));
     }
}
